package test.java;

import main.java.Archives;
import main.java.Emp;
import main.java.HibernateUtil;
import org.hibernate.Session;

/**
 * Created by datou on 2017/2/5.
 */
public class test {
    public static void main(String[] args) {
        Emp emp=new Emp();
        emp.setAge(12);
        emp.setName("Xiaoliu");
        Archives archives=new Archives();
        archives.setEname("小龙");
        archives.setEmp(emp);
        Session session= HibernateUtil.getSession();
        session.save(archives);
        session.close();
    }
}
